import Cookies from 'js-cookie'
// Cookies.set(标志, 值)
// Cookies.get(标记)
// Cookies.remove(标记)

const TokenKey = 'hrsaas-ihrm-token'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

// 处理 Cookies 时间记录的函数

const timeKey = 'timestamp'

export function setTimestamp() {
  Cookies.set(timeKey, Date.now())
}

export function getTimestamp() {
  return Cookies.get(timeKey)
}
